﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ABPIdentityDemo
{
    public class User
    {
        public string Name { get; set; }
        public string Email { get; set; }
        public Role Role { get; set; }
    }

    /// <summary>
    /// 这里的存储角色的策略授权，字符串数字等都行，只要能够存储表示就OK
    /// <para>在这里没有任何意义，只是标识的一种方式</param>
    /// </summary>
    public class Role
    {
        public List<string> Permissions { get; set; }
    }

    public static class UserInfoData
    {
        public static readonly List<User> Users = new List<User>();

        static UserInfoData()
        {
            Users.Add(new User
            {
                Name = "Ryan",
                Email = "Ryan@io.com",
                Role = new Role
                {
                    Permissions = new List<string>
                    {
                        "WeatherPermission",
                        "Weather_Get01"
                    }
                }
            });

            Users.Add(new User
            {
                Name = "Test01",
                Email = "Test01@io.com",
                Role = new Role
                {
                    Permissions = new List<string>
                    {
                        "WeatherPermission",
                        "Weather_Get02"
                    }
                }
            });
        }
    }
}
